<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib prefix="vtc" uri="/ls-trade-tags"%>
<%@ include file="/common/taglibs.jsp"%>

<html>
<head>
	<title>设备<s:text name="common.btn.search"/></title>
	
	<script type="text/javascript">
		function clickBtn(action,event){
			
			switch(action){
			case "cancel":
				window.location="device!list.action";
				return;
				
			case "reset":
				$("#mainForm").reset();
				return;
				
			case "save":
				$("#mainForm").attr("action","device!save.action");
				break;	
				
			case "delete":
				$("#mainForm").attr("action","device!delete.action");
				break;	
				
			}
			
			$("#mainForm").submit();
		}
	</script>

</head>
<body>

<div class="content"> 

    <div class="pageTitle">Edit Device</div>
    
    <s:form id="mainForm" name="mainForm" action="device!save.action" method="post">
    	<s:hidden name="device.id" id="deviceId"></s:hidden>
    	
   	 <div class="form2">
   	 
      <table cellspacing="0" cellpadding="0" border="0">
        <tbody><tr>
          <td class="sep"><img style="width:180px;" src="../images/spacer.gif"></td>
          <td class="sep sep2"><img src="../images/spacer.gif"></td>
        </tr>
        <tr>
          <td><label class="fLabel">Name</label>
            <div class="fField">
	            <s:textfield cssClass="required" cssStyle="width:180px" name="device.name"/>
            </div>
            </td>
          <td><label class="fLabel">Serial Number</label>
            <div class="fField">
              <s:textfield cssClass="required" cssStyle="width:180px" name="device.serialNumber"/>
            </div></td>
        </tr>

        <tr>
          <td colspan="2"><label class="fLabel">Address</label>
            <div class="fField">
              <s:textarea name="device.address" id="deviceAddress" cssClass="inputTextarea" cssStyle="width:500px; height:100px"></s:textarea>	
            </div></td>
        </tr>
        
		<tr>
           <td><label class="fLabel">Status</label>
             <div class="fField">
               <input type="text" disabled="disabled" style="width:150px" value="<s:property value='device.status'/>" name="status" id="status" class="inputText">
             </div>
           </td>
        </tr> 
      </tbody>
      </table>
      
      <div class="btnSet btnSetTypeB">
       	  <div class="left">
				<div class="button">
	              <div class="left">
	                <div class="right">
	                  <input type="button" onclick="clickBtn('save')" value="Save" class="inputButton">
	                </div>
	              </div>
	            </div>    
	            
	           <div class="button">
	             <div class="left">
	               <div class="right">
	               	 <input type="button" onclick="clickBtn('reset')" value="Reset"  class="inputButton">
	               </div>
	             </div>
	           </div>  	
	      
	          <div class="button">
	            <div class="left">
	              <div class="right">
	                <input type="button" onclick="clickBtn('cancel')" value="Cancel" class="inputButton">
	              </div>
	            </div>
	          </div>
	          
	          <div class="button">
	            <div class="left">
	              <div class="right">
	                <input type="button" onclick="clickBtn('delete')" value="<s:text name='common.btn.delete'/>" class="inputButton">
	              </div>
	            </div>
	          </div>          
          
          </div>
        </div>
     
   </div>
   
   </s:form>
</div>
    

</body>
</html>